'use strict';

const { log } = require('console');
const { Controller } = require('egg');
const fs = require('fs');
const path = require('path');
class TeacherController extends Controller {
  async application() {
    const { ctx } = this;
    console.log(this.ctx.request.body);
    const { coursetpye, lianjie, Contact, Information } = this.ctx.request.body;
    const sql2 = `insert into teacher (coursetpye,lianjie,Contact,Information) values ('${coursetpye}','${lianjie}','${Contact}','${Information}')`;
    const res2 = await this.ctx.app.mysql.query(sql2);
    ctx.body = {
      code: 2000,
      info: '注册成功',
    };
    console.log(ctx.body);
  }
}

module.exports = TeacherController;
